const http = require('http');

const server = http.createServer(function (req, res) {
  // 处理请求
  const body = 'Hello World';
  res.setHeader('Content-Length', body.length);
  res.setHeader('Content-Type', 'text/plain');
  res.end(body);
});
server.listen(3000);
